package com.lhkj.ct.platform.service.impl;

import com.lhkj.ct.base.utils.ShiroUtil;
import com.lhkj.ct.meta.modules.psychology.mapper.PsyRecordMapper;
import com.lhkj.ct.meta.modules.questionnaire.mapper.QnrAllotRecordMapper;
import com.lhkj.ct.platform.service.MyPersonalCenterService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

/**
 * <p>
 *     描述：用户中心
 * </p>
 */
@Service
public class MyPersonalCenterServiceImpl implements MyPersonalCenterService {

    @Resource
    private PsyRecordMapper psyRecordMapper;

    @Resource
    private QnrAllotRecordMapper qnrAllotRecordMapper;

    @Override
    public Map<String, Long> count() {
        Map<String, Long> count = new HashMap<>();
        Long psy = psyRecordMapper.countNotDoneByPatient(ShiroUtil.getAuthUserInfo().getUserId());
        Long qnr = qnrAllotRecordMapper.countNotDoneByPatient(ShiroUtil.getAuthUserInfo().getUserId());
        count.put("psy", psy);
        count.put("qnr", qnr);
        return count;
    }
}
